var limsZkSample = Gikam.getPageObject({

    baseUrl : IFM_CONTEXT + '/secure/basemodule/basedata/zk-samples',
    templateUrl : IFM_CONTEXT + '/secure/basemodule/basedata/zk-sample-templates',
    templateTestUrl : IFM_CONTEXT + '/secure/basemodule/coredata/experimental-template-tests',

    getZkSampleColumns : function () {
        return [ /*{
            checkbox : true
        },*/ {index: true},{
            field : 'zkTypeCode',
            validators : ['notEmpty'],
            title : 'T_LIMS_ZK_SAMPLE.ZKTYPECODE',
            width : 160
        }, {
            field : 'zkTypeName',
            title : 'T_LIMS_ZK_SAMPLE.ZKTYPENAME',
            validators : ['notEmpty'],
            width : 160
        }, {
            field : 'zkBriefCode',
            title : 'T_LIMS_ZK_SAMPLE.ZKBRIEFCODE',
            width : 160,
            editor : true,
            validators : ['remote[/secure/basemodule/basedata/zk-samples/action/validate-unique]', 'notEmpty', 'strLength[0,12]']
        } ];
    },

    getZkSampleFields : function () {
        return[{
            field : 'zkTypeCode',
            title : 'T_LIMS_ZK_SAMPLE.ZKTYPECODE',
            validators : ['remote[/secure/basemodule/basedata/zk-samples/action/validate-unique]', 'notEmpty', 'strLength[0,30]'],
            preInsert : true
        }, {
            field : 'zkTypeName',
            title : 'T_LIMS_ZK_SAMPLE.ZKTYPENAME',
            preInsert : true,
            firstBlank : false,
            type : 'select',
            category : 'sys',
            param : {
                codeCategoryId_EQ : 'zkTypeName'
            },
            validators : ['notEmpty']
        }, {
            field : 'zkBriefCode',
            title : 'T_LIMS_ZK_SAMPLE.ZKBRIEFCODE',
            preInsert : true,
            validators : ['remote[/secure/basemodule/basedata/zk-samples/action/validate-unique]', 'notEmpty', 'strLength[0,12]']
        }]
    },

    getZkSampleTemplateColumns : function () {
        return[{
            checkbox : true
        },{index: true},{
            field : 'ext$.etcode',
            title : 'T_LIMS_EXPERIMENTAL_TEMPLATE.ETCODE',
            width : 160
        },{
            field : 'ext$.etname',
            title : 'T_LIMS_EXPERIMENTAL_TEMPLATE.ETNAME',
            validators : ['notEmpty'],
            width : 160
        },{
            field : 'ext$.judgname',
            title : 'T_LIMS_JUDGMENT_BASIS.JUDGNAME',
            validators : ['notEmpty'],
            width : 160
        },{
            field : 'ext$.judgcode',
            title : 'T_LIMS_JUDGMENT_BASIS.JUDGCODE',
            width : 160
        }]
    },

    getZkSampleTemplateChooseColumns : function () {
        return[{
            field : 'ext$.etcode',
            title : 'T_LIMS_EXPERIMENTAL_TEMPLATE.ETCODE',
            width : 160
        },{
            field : 'ext$.etname',
            title : 'T_LIMS_EXPERIMENTAL_TEMPLATE.ETNAME',
            validators : ['notEmpty'],
            width : 160
        },{
            field : 'ext$.judgname',
            title : 'T_LIMS_JUDGMENT_BASIS.JUDGNAME',
            validators : ['notEmpty'],
            width : 160
        },{
            field : 'ext$.judgcode',
            title : 'T_LIMS_JUDGMENT_BASIS.JUDGCODE',
            width : 160
        }]
    },

    getZkSampleTemplateFields : function () {
        return[{
            field : 'etName',
            title : 'T_LIMS_EXPERIMENTAL_TEMPLATE.ETNAME',
            type : 'choose',
            category : 'experimental-template-choose',
            validators : ['notEmpty'],
            preInsert : true,
            single: true,
            cleanable: false,
            onAfterChoose : function (rows, index) {
                if (rows){
                    this.setData({
                        spId : rows[0].id,
                        etName : rows[0].etName
                    })
                }
            }
        },{
            field : 'judgName',
            title : 'T_LIMS_JUDGMENT_BASIS.JUDGNAME',
            type : 'choose',
            single: true,
            cleanable: false,
            category : 'judgment-choose',
            preInsert : true,
            validators : ['notEmpty'],
            onAfterChoose : function (rows, index) {
                if (rows){
                    this.setData({
                        specId : rows[0].id,
                        judgName : rows[0].judgName
                    })
                }
            }
        }]
    },

    getZkSampleTemplateTestColumns : function () {
        return[{
            field : 'orderNo',
            title : 'T_LIMS_EXPERIMENTAL_TEMPLATE_TEST.ORDERNO',
            width : 100
        },{
            field : 'testId',
            title : 'T_LIMS_EXPERIMENTAL_TEMPLATE_TEST.ID',
            width : 200
        },{
            field : 'testCode',
            title : 'T_LIMS_TEST.TESTCODE',
            width : 160
        },{
            field : 'testName',
            title : 'T_LIMS_EXPERIMENTAL_TEMPLATE_TEST.TESTNAME',
            width : 160
        },{
            field : 'lastTestNames',
            title : 'T_LIMS_EXPERIMENTAL_TEMPLATE_TEST.LASTTESTNAMES',
            width : 160
        },{
            field : 'lastTestIds',
            title : 'T_LIMS_EXPERIMENTAL_TEMPLATE_TEST.LASTTESTIDS',
            width : 200
        }]
    }
});
